home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1992 June: ROMin Holiday / ADC Developer CD (1992-06) (''ROMin Holiday'')_iso / Developer Connection - 06-1992.iso / Tools & Apps / Testing & Debugging / VUAssist 1.0d10 / VUAssist Source Code / UVUAssist.p < prev   
Encoding:
Text File  |  1991-09-10  |  6.1 KB  |  191 lines  |  [TEXT/MPS ]

  1. (*+
  2.  *    File:        UVUAssist.p
  3.  *
  4.  *    Contains:    VU Assistance class - MacApp 3.0b2PQR compatible version
  5.  *
  6.  *    Written by:    David Shayer
  7.  *
  8.  *    Copyright:    © 1991 by Apple Computer, Inc., all rights reserved.
  9.  *
  10.  *  Version: 1.0d10
  11.  *
  12.  *         9/10/91    JAS      indicate 3.0b2PQR compatibility, change version
  13.  *         8/21/91    JAS      change version
  14.  *         8/20/91    JAS      remove debugging code
  15.  *         8/19/91    JAS      rev comments and change case of GridItemSupport to 
  16.  *                          gridItemSupport
  17.  *         8/16/91    JAS      change interfaces for 3.0b2PQR
  18.  *         8/15/91    JAS      remove unneeded interfaces
  19.  *         8/15/91    JAS      add fGridItemSupport data member to TVUAssist and change
  20.  *                          prototype of IVUAssist to take GridItemSupport as input
  21.  *         8/13/91    JAS      include gridItem parameter in FillDlogItemDesc and RankToItem 
  22.  *         8/13/91    JAS      make TGridItem direct descendant of TObject instead of 
  23.  *                          TGridView
  24.  *         8/6/91        JAS      remove TVUAssist.DoFindWindowInfo (not needed) 
  25. -*)
  26.  
  27.  
  28. {Historical Note:  References to the "Mole" are equivalent to references to "Agent VU".
  29. "Agent VU" was previously called the "Mole".}
  30.  
  31. (*
  32.  
  33. So you wanna use V.U. to test your MacApp program?  You need to help Agent VU find things
  34. in your windows, since MacApp views appear empty to Agent VU.  Fortunately, Agent VU has a 
  35. hook for an assistance procedure.  The assistance procedure is a routine, in the application
  36. being manipulated by V.U., that feeds Agent VU inside information about what's in the
  37. views.  This unit implements that assistance routine.
  38.  
  39. This unit contains 4 files: VUAssist.p, VUAssist.inc1.p, VUAssist.inc2.p,
  40. and VUAssist.a.
  41.  
  42. See the "READ ME FIRST!" file for instructions on how to use VUAssist and other information.
  43.  
  44. *)
  45.  
  46.  
  47. UNIT UVUAssist;
  48.  
  49.     INTERFACE
  50.  
  51.         USES
  52.         
  53.             Types, MacAppTypes, Memory, UPascalObject, UObject, UList, AppleEvents, UEvent, 
  54.             UCommand, Dialogs, UEventHandler, UCommandHandler, UApplication, Balloons, UAdorners, 
  55.             UStream, UView, UWindow, UBehavior, UViewBehavior, UPrintHandler, UFailure,
  56.             UGeometry, OSUtils, Menus, UMenuMgr,
  57.  
  58.             { • Building Blocks }
  59.             PrintTraps, UPrinting, UGridView, UTEView, UControl, UDialog, UPopup,
  60.     
  61.             { • System Interfaces }
  62.             Errors,
  63.             Resources,
  64.             AppleTalk, ToolUtils,
  65.             OSEvents,
  66.             Packages,
  67.             Devices,
  68.             Script;
  69.     
  70.     
  71.         {$I UVUAssist.inc1.p}
  72.  
  73.         TYPE
  74.  
  75.             TGridItem = OBJECT (TObject)
  76.                 
  77.                 fGridView:    TGridView;        { reference to a TGridView object}
  78.                     
  79.                 fColumn:    longint;        { 1 based counter }
  80.                 
  81.                 fRow:        longint;        { 1 based counter }
  82.                 
  83.                 fRank:        longint;        { (row-1) * rowlength + column }
  84.                 
  85.                 PROCEDURE TGridItem.IGridItem(theGridView: TGridView; Rank: integer);
  86.  
  87.                 PROCEDURE TGridItem.GetExtent(VAR itsExtent: VRect); 
  88.         
  89.                 PROCEDURE TGridItem.LocalToWindow(VAR thePoint: VPoint); 
  90.             
  91.                 END;
  92.  
  93.     
  94.             { There is a another definition of this object in UVUAssist.a, which is
  95.             a subset of this definition. If you update this definition, be sure to 
  96.             update the one in UVUAssist.a, if necessary. }
  97.             TVUAssist = OBJECT (TEventHandler)
  98.                 
  99.                 fMoleRefNum :integer;
  100.         
  101.                 fGridItemSupport :boolean;
  102.                 
  103.                 PROCEDURE TVUAssist.IVUAssist(gridItemSupport: boolean);
  104.         
  105.                 PROCEDURE TVUAssist.OpenMoleDriver;
  106.         
  107.                 PROCEDURE TVUAssist.SuspendMole;
  108.         
  109.                 PROCEDURE TVUAssist.ResumeMole; 
  110.         
  111.                 PROCEDURE TVUAssist.SetDebuggerHook (NewHook :ProcPtr); 
  112.         
  113.                 FUNCTION TVUAssist.MoleAssist (Select :integer; Input :Ptr; Output :Ptr; 
  114.                     VAR OutputSize :integer; IntResult :integer) :integer; 
  115.                 
  116.                 FUNCTION TVUAssist.DoMenuInfo (Input :Ptr; Output :Ptr; VAR OutputSize :integer; 
  117.                     Result :MoleError) :MoleError;
  118.         
  119.                 FUNCTION TVUAssist.DoMenuItems (Input :Ptr; Output :Ptr; VAR OutputSize :integer; 
  120.                     Result :MoleError) :MoleError;
  121.         
  122.                 FUNCTION TVUAssist.DoSendWindowInfo (Input :Ptr; Output :Ptr; 
  123.                     VAR OutputSize :integer; Result :MoleError) :MoleError;
  124.         
  125.                 FUNCTION TVUAssist.DoFindControl (Input :Ptr; Output :Ptr; 
  126.                     VAR OutputSize :integer; Result :MoleError) :MoleError;
  127.         
  128.                 FUNCTION TVUAssist.DoSendControlInfo (Input :Ptr; Output :Ptr; 
  129.                     VAR OutputSize :integer; Result :MoleError) :MoleError;
  130.         
  131.                 FUNCTION TVUAssist.DoSendDlogItemInfo (Input :Ptr; Output :Ptr; 
  132.                     VAR OutputSize :integer; Result :MoleError) :MoleError;
  133.         
  134.                 PROCEDURE TVUAssist.FillPopupDesc (Popup: TPopup; MenuRank: integer; 
  135.                     MenuDescPtr :MoleMenuInfoPtr; VAR OutputSize :integer);
  136.         
  137.                 FUNCTION TVUAssist.FillPopupItemDesc (Popup: TPopup; MenuRank: integer; 
  138.                     start: integer; stop: integer; MenuItemDescPtr :MoleDataBlockPtr; 
  139.                     VAR OutputSize :integer) :MoleError;
  140.         
  141.                 FUNCTION TVUAssist.FillCtrlDesc (CtrlDescPtr :MoleCDescPtr; thePart :integer; 
  142.                     WindRank :integer; ControlRank :integer; Control :TControl; 
  143.                     VAR OutputSize :integer): Boolean;
  144.         
  145.                 PROCEDURE TVUAssist.ViewRectToWindowRect (VAR aRect :Rect; aView :TView);
  146.         
  147.                 PROCEDURE TVUAssist.FillDlogItemDesc (DlogDescPtr :MoleDItemInfoPtr; 
  148.                     Window :TWindow; WindRank :integer; ItemRank :integer; Item :TView; 
  149.                     VAR OutputSize :integer; gridItem :TGridItem );
  150.         
  151.                 FUNCTION TVUAssist.RankToWindow (Rank :integer) :TWindow;
  152.                 
  153.                 FUNCTION TVUAssist.WindowToRank (WindToFind :WindowPeek) :integer;
  154.         
  155.                 PROCEDURE TVUAssist.GlobalToWindow (Window :TWindow; Pt :Point; VAR VPt :VPoint);
  156.         
  157.                 PROCEDURE TVUAssist.WindowToView (View :TView; VAR VPt :VPoint; VAR Pt :Point);
  158.         
  159.                 FUNCTION TVUAssist.MenuIDToPopup (MenuID :integer) :TPopup;
  160.         
  161.                 FUNCTION TVUAssist.PointToControl (Window :TWindow; Pt :Point; 
  162.                     VAR Rank :integer) :TCtlMgr;
  163.         
  164.                 FUNCTION TVUAssist.ItemToRank (Window :TWindow; View :TView; 
  165.                     DlogViewItems :Boolean) :integer;
  166.         
  167.                 FUNCTION TVUAssist.RankToItem (Window :TWindow; Rank :integer; 
  168.                     DlogViewItems :Boolean; VAR gridItem: TGridItem ) :TView;
  169.         
  170.                 FUNCTION TVUAssist.ViewCount (Window :TWindow; DlogViewItems :Boolean) :integer;
  171.         
  172.                 FUNCTION TVUAssist.CountGridItems (theGridView: TGridView): integer;
  173.         
  174.                 FUNCTION TVUAssist.GetItemType (Item :TView; DlogViewItems :Boolean;
  175.                     GridViewItems: Boolean) :ViewItems;
  176.         
  177.             
  178.             END;
  179.  
  180.             
  181.         VAR
  182.             gVUAssist :                    TVUAssist;        { the mole assist proc }
  183.  
  184.     
  185.     IMPLEMENTATION
  186.  
  187.         {$I UVUAssist.inc2.p}
  188.  
  189.  
  190. END.
  191.